<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    账号<h2></h2>
    密码<h2></h2>
    <script>
        let obj = {}
        let h2 = document.querySelectorAll("h2")
        let searchValue = location.search.slice(1)

        console.log(searchValue.split("&"));

        searchValue.split("&").forEach(function(item){
            console.log(item.split("=")[0],item.split("=")[1]);
            //URL资源标识符
            //encodeURI加密
            //decodeURI解密
            obj[item.split("=")[0]] = encodeURI(item.split("=")[1])
        })
        h2[0].innerHTML = obj.user
        h2[1].innerHTML = obj.psw
    </script>
</body>
</html>